/*
** Lua binding: LUAGame
** Generated automatically by tolua++-1.0.92 on 06/19/10 12:43:41.
*/

#ifndef __cplusplus
#include "stdlib.h"
#endif
#include "string.h"

#include "tolua++.h"
#include "Game.h"
/* Exported function */
int tolua_LUAGame_open (lua_State* tolua_S);


/* function to register type */
static void tolua_reg_types (lua_State* tolua_S)
{
 tolua_usertype(tolua_S,"CGame");
}

/* method: requestStateChange of class  CGame */
#ifndef TOLUA_DISABLE_tolua_LUAGame_CGame_requestStateChange00
static int tolua_LUAGame_CGame_requestStateChange00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
 !tolua_isusertype(tolua_S,1,"CGame",0,&tolua_err) ||
 !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
 !tolua_isnoobj(tolua_S,3,&tolua_err)
 )
 goto tolua_lerror;
 else
#endif
 {
  CGame* self = (CGame*)  tolua_tousertype(tolua_S,1,0);
  GameState state = ((GameState) (int)  tolua_tonumber(tolua_S,2,0));
#ifndef TOLUA_RELEASE
 if (!self) tolua_error(tolua_S,"invalid 'self' in function 'requestStateChange'",NULL);
#endif
 {
  bool tolua_ret = (bool)  self->requestStateChange(state);
 tolua_pushboolean(tolua_S,(bool)tolua_ret);
 }
 }
 return 1;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'requestStateChange'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* method: getCurrentState of class  CGame */
#ifndef TOLUA_DISABLE_tolua_LUAGame_CGame_getCurrentState00
static int tolua_LUAGame_CGame_getCurrentState00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
 !tolua_isusertype(tolua_S,1,"CGame",0,&tolua_err) ||
 !tolua_isnoobj(tolua_S,2,&tolua_err)
 )
 goto tolua_lerror;
 else
#endif
 {
  CGame* self = (CGame*)  tolua_tousertype(tolua_S,1,0);
#ifndef TOLUA_RELEASE
 if (!self) tolua_error(tolua_S,"invalid 'self' in function 'getCurrentState'",NULL);
#endif
 {
  GameState tolua_ret = (GameState)  self->getCurrentState();
 tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
 }
 }
 return 1;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'getCurrentState'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* method: getSingleton of class  CGame */
#ifndef TOLUA_DISABLE_tolua_LUAGame_CGame_getSingleton00
static int tolua_LUAGame_CGame_getSingleton00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
 !tolua_isusertable(tolua_S,1,"CGame",0,&tolua_err) ||
 !tolua_isnoobj(tolua_S,2,&tolua_err)
 )
 goto tolua_lerror;
 else
#endif
 {
 {
  CGame& tolua_ret = (CGame&)  CGame::getSingleton();
 tolua_pushusertype(tolua_S,(void*)&tolua_ret,"CGame");
 }
 }
 return 1;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'getSingleton'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* method: getSingletonPtr of class  CGame */
#ifndef TOLUA_DISABLE_tolua_LUAGame_CGame_getSingletonPtr00
static int tolua_LUAGame_CGame_getSingletonPtr00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
 !tolua_isusertable(tolua_S,1,"CGame",0,&tolua_err) ||
 !tolua_isnoobj(tolua_S,2,&tolua_err)
 )
 goto tolua_lerror;
 else
#endif
 {
 {
  CGame* tolua_ret = (CGame*)  CGame::getSingletonPtr();
 tolua_pushusertype(tolua_S,(void*)tolua_ret,"CGame");
 }
 }
 return 1;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'getSingletonPtr'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* Open function */
int tolua_LUAGame_open (lua_State* tolua_S)
{
 tolua_open(tolua_S);
 tolua_reg_types(tolua_S);
 tolua_module(tolua_S,NULL,0);
 tolua_beginmodule(tolua_S,NULL);
 tolua_constant(tolua_S,"STARTUP",STARTUP);
 tolua_constant(tolua_S,"GUI",GUI);
 tolua_constant(tolua_S,"LOADING",LOADING);
 tolua_constant(tolua_S,"CANCEL_LOADING",CANCEL_LOADING);
 tolua_constant(tolua_S,"SIMULATION",SIMULATION);
 tolua_constant(tolua_S,"SHUTDOWN",SHUTDOWN);
 tolua_cclass(tolua_S,"CGame","CGame","",NULL);
 tolua_beginmodule(tolua_S,"CGame");
  tolua_function(tolua_S,"requestStateChange",tolua_LUAGame_CGame_requestStateChange00);
  tolua_function(tolua_S,"getCurrentState",tolua_LUAGame_CGame_getCurrentState00);
  tolua_function(tolua_S,"getSingleton",tolua_LUAGame_CGame_getSingleton00);
  tolua_function(tolua_S,"getSingletonPtr",tolua_LUAGame_CGame_getSingletonPtr00);
 tolua_endmodule(tolua_S);
 tolua_endmodule(tolua_S);
 return 1;
}


#if defined(LUA_VERSION_NUM) && LUA_VERSION_NUM >= 501
 int luaopen_LUAGame (lua_State* tolua_S) {
 return tolua_LUAGame_open(tolua_S);
};
#endif

